<template>
  <h3>provide和inject实现组件传参</h3>
  <div class="container">
    <Sun></Sun>
    <GrandChild></GrandChild>
  </div>
</template>

<script setup lang="ts">
import { provide } from 'vue'
import GrandChild from './GrandChild.vue'
import Sun from './Sun.vue'

provide('message', 'provide提供的数据')
</script>

<style scoped>
.container {
  display: flex;
  align-items: center;
  justify-content: space-around;
  width: 500px;
  height: 500px;
}
</style>
